// 权限管理API
import request from '@/utils/request'

// 获取权限点列表
export function getPermissionList() {
  return request({
    url: '/sys/permission'
  })
}

// 添加权限点
export function postPermission(data) {
  return request({
    url: '/sys/permission',
    method: 'POST',
    data
  })
}

// 删除权限
export function deletePermissionById(id) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'DELETE'
  })
}

// 获取权限点详情
export function getPermissionDetailById(id) {
  return request({
    url: `/sys/permission/${id}`
  })
}

// 修改权限点
export function updatePermissionById(data) {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'PUT',
    data
  })
}
